package com.yu.util;

import org.aspectj.lang.ProceedingJoinPoint;

public class Advice {
	public void before() {
		System.out.println("权限校验");
	}

	public void after() {
		System.out.println("日志记录");
	}

	public Object around(ProceedingJoinPoint pjp) throws Throwable {
		long start = System.currentTimeMillis();
		Object method = pjp.proceed();
		long end = System.currentTimeMillis();
		System.out.println("方法执行时间为:" + (end - start) + "毫秒");
		return method;
	}

	public void exception(Exception ex) {
		System.out.println("异常通知");
		System.out.println("异常内容:" + ex.getMessage());
	}
}